<?php

namespace app\admin\behavior;

use app\admin\model;

class OrderCreate {

    public function run(&$order_id) {
        $order = model\order\Main::get($order_id);
        model\CompanyBalanceLog::create([
            'title' => model\CompanyBalanceLog::$title['cancel_create'],
            'admin_id' => $order->admin->id,
            'create_time' => date('Y-m-d H:i:s'),
            'from' => $order->admin->company->balance + $order->price,
            'to' => $order->admin->company->balance,
            'value' => $order->price,
            'type' => model\CompanyBalanceLog::$out,
        ]);
    }

}
